package offer.algorithm;

import java.util.Scanner;

/**
 * Description：
 * Author: zhangc
 * Date：2017/9/10 15:47
 */
public class XOR {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int total = scanner.nextInt();
        int[] arr = new int[ total ];
        for (int i = 0; i < total; i++) {
            arr[ i ] = scanner.nextInt();
        }
        System.out.println(getNum(arr));
    }

    public static int getNum(int[] arr) {
        int result = 0;
        int orVal;
        int j;
        boolean status;
        for (int i = 0; i < arr.length; i++) {
            orVal = arr[ i ];
            status = false;
            for (j = i + 1; j < arr.length; j++) {
                if (orVal == 0) {
                    result++;
                    i++;
                    break;
                } else {
                    orVal = orVal ^ arr[ j ];
                    if (orVal == 0) {
                        result++;
                        i = j;
                        status = true;
                        break;
                    }
                }
            }
            if (j == arr.length)
                j--;
            int[] num = getNum(arr, i, j);
            if (!status && num[ 0 ] > 0) {
                i = num[ 1 ];
                result++;
            } else if (status && num[ 0 ] >= 2) {
                result = result + num[ 0 ] - 1;
                i = num[ 1 ] + 1;
            }
        }
        return result + 1;
    }

    public static int[] getNum(int[] arr, int low, int high) {
        int[] array = new int[ 2 ];
        array[ 0 ] = 0;
        int j = 0, orVal;
        for (int i = low; i <= high; i++) {
            orVal = arr[ i ];
            for (j = i + 1; j <= high; j++) {
                if (orVal == 0) {
                    array[ 0 ]++;
                    break;
                } else {
                    orVal = orVal ^ arr[ j ];
                    if (orVal == 0) {
                        array[ 0 ]++;
                        i = j;
                        break;
                    }
                }
            }
        }
        array[ 1 ] = j;
        return array;
    }
}
